home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: mchamp@ix.netcom.com (Michael Champagne)
- Newsgroups: comp.lang.c++
- Subject: Re: Braces and Inline Assembly?
- Date: Sat, 03 Feb 1996 19:38:00 GMT
- Organization: Netcom
- Message-ID: <4f0di9$rhc@reader2.ix.netcom.com>
- References: <4eubgp$6ui@ixnews6.ix.netcom.com> <4eudng$59c@ixnews7.ix.netcom.com>
- NNTP-Posting-Host: ix-dfw17-26.ix.netcom.com
- X-NETCOM-Date: Sat Feb 03 11:37:45 AM PST 1996
- X-Newsreader: Forte Free Agent 1.0.82
-
- >mchamp@ix.netcom.com (Michael Champagne) wrote:
-
- >>Ok.. I'm new to using inline assembly and I was wondering why this
- >>compiles:
-
- >>void set_mode(const int mode)
- >>{
- >> asm {
- >> mov AH, 0;
- >> mov AL, byte ptr mode;
- >> int 10h;
- >> }
- >>}
-
- >>and this doesn't..
-
- >>void set_mode(const int mode)
- >>{
- >> asm
- >> {
- >> mov AH, 0;
- >> mov AL, byte ptr mode;
- >> int 10h;
- >> }
- >>}
-
- >>Seems like it's the exact same code.. does the placement of the
- >>braces matter when using the 'asm' statement? In the second one the
- >>compiler doesn't recognize the 'mov' and says there needs to be a
- >>couple of semicolons stuck in there.
-
- >>Thanks in advance,
-
- >>Mike
-
-
- >Sounds like you're using an older version of Borland C/C++. Perhaps
- >version 3.1 or prior? In those versions the opening brace is required
- >on the same line as the the asm keyword. In later versions, the brace
- >doesn't have to be anywhere special.
-
- >Jason
-
- Nope, I'm using Turbo C++ 4.0.. Hrmm.. weird.
-
- Well I guess I'll just remember to put it on the same line. Thanks
- for the reply though.
-
- Mike
-
-
-
-